home *** CD-ROM | disk | FTP | other *** search
/ 100 Plus Great Games 2 / 100PLUSV2.BIN / games / RoboticInvaders.dxr / 00003_Initialization Scripts.ls < prev    next >
Encoding:
Text File  |  2002-01-25  |  2.3 KB  |  79 lines

  1. global playerShipSO, armorSO, pBulletSO, eBulletSO, enemySO, enemyData, fleetMovementData, playerData, pBulletData, eBulletData, armorData, playerlevel
  2.  
  3. on initializeEnemyBugs
  4.   global frameNumber, frameDelay, swooperType
  5.   frameNumber = 0
  6.   frameDelay = 0
  7.   fleetMovementData = [point(0, 100), #right, 0]
  8.   case playerlevel of
  9.     1:
  10.       maxLines = 4
  11.       eTypes = [2, 1, 1, 1]
  12.     2:
  13.       maxLines = 4
  14.       eTypes = [3, 2, 1, 1]
  15.     3:
  16.       maxLines = 4
  17.       eTypes = [4, 3, 2, 1]
  18.     4:
  19.       maxLines = 4
  20.       eTypes = [4, 3, 2, 2]
  21.     5:
  22.       maxLines = 4
  23.       eTypes = [4, 4, 3, 2]
  24.   end case
  25.   swooperType = eTypes[1]
  26.   enemyData = []
  27.   wSprite = enemySO - 1
  28.   repeat with xBug = 1 to 10
  29.     repeat with yBug = 1 to maxLines
  30.       wSprite = wSprite + 1
  31.       anchorLoc = point(xBug * 40, yBug * 40) + point(-20, -20)
  32.       startingLoc = point(random(1000 - 400), 0 - random(150))
  33.       add(enemyData, [1, eTypes[yBug], 0, anchorLoc, startingLoc, 0, 0])
  34.       set the loc of sprite wSprite to point(xBug * 40, yBug * 40) + fleetMovementData[1]
  35.       set the ink of sprite wSprite to 36
  36.     end repeat
  37.   end repeat
  38. end
  39.  
  40. on initializeArmors
  41.   armorData = []
  42.   totalArmors = 4
  43.   repeat with wArmor = 1 to totalArmors
  44.     wSprite = armorSO + wArmor - 1
  45.     spawnloc = point(580.0 / (totalArmors + 1) * wArmor, 350)
  46.     set the loc of sprite wSprite to spawnloc
  47.     sprite(wSprite).visible = 1
  48.     aSize = point(70, 20)
  49.     sizeRect = rect(spawnloc[1] - (aSize[1] / 2), spawnloc[2] - (aSize[2] / 2), spawnloc[1] + (aSize[1] / 2), spawnloc[2] + (aSize[2] / 2))
  50.     add(armorData, [4, spawnloc, sizeRect])
  51.     set the member of sprite wSprite to "Armor 4"
  52.   end repeat
  53. end
  54.  
  55. on initializeplayer
  56.   playerData = [1, point(290, 390), 0]
  57.   set the loc of sprite playerShipSO to point(580 / 2, 360)
  58. end
  59.  
  60. on initializePBullets
  61.   pBulletData = []
  62.   repeat with wPBullet = 1 to 10
  63.     wSprite = pBulletSO + wPBullet - 1
  64.     add(pBulletData, [0, point(0, 0), 0, 0])
  65.     set the loc of sprite wSprite to point(-50, -50)
  66.     set the ink of sprite wSprite to 36
  67.   end repeat
  68. end
  69.  
  70. on initializeEBullets
  71.   eBulletData = []
  72.   repeat with wEBullet = 1 to 10
  73.     wSprite = eBulletSO + wEBullet - 1
  74.     add(eBulletData, [0, point(0, 0), 0, 0])
  75.     set the loc of sprite wSprite to point(-50, -50)
  76.     set the ink of sprite wSprite to 36
  77.   end repeat
  78. end
  79.